package com.test.security.springsecuritydemo9.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @since 2023/1/4 上午10:06
 */
@Controller
public class MainController {
    private static final Logger LOGGER = LoggerFactory.getLogger(MainController.class);

    @GetMapping("/main")
    public String main() {
        return "main.html";
    }

    @CrossOrigin("http://localhost:8088")
    @PostMapping("/test")
    @ResponseBody
    public String test() {
        LOGGER.info("Test method called");
        return "HELLO";
    }
}
